package com.yuqiaotech.zcj.auth.action;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.config.ParentPackage;
import org.apache.struts2.config.Result;
import org.apache.struts2.config.Results;
import com.yuqiaotech.zcj.Constants;
import com.yuqiaotech.zcj.auth.model.User;
import com.yuqiaotech.zcj.service.UserManager;
/**
 * 注册。
 * 
 */
@ParentPackage(value = "normal")
@Results( { @Result(name = "index", value = "/index.jsp") })
public class RegisterAction {
	private String msg;
	private User user;
	private UserManager userManager;
	public String execute() {
		user = userManager.save(user);
		ServletActionContext.getRequest().getSession().setAttribute(
				Constants.USER_KEY, user);
		return "index";
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public UserManager getUserManager() {
		return userManager;
	}

	public void setUserManager(UserManager userManager) {
		this.userManager = userManager;
	}

}
